<?php
Zend_Loader::loadClass("Application_Ajax_Server_Function");
Zend_Loader::loadClass('Panes');
class GetPaneList extends Application_Ajax_Server_Function
{
	public function call() {
		$vetri = new Panes();
		if (!$this->_getParam('id', false)) {
			$recordSet = $vetri->select()->from($vetri, array("id", "name"))
			->where("status > ?", 0)
			->order("name");
		} else {
			$recordSet = $vetri->select()->from($vetri, array("id", "name"))
			->where("id_category = ?", $this->_getParam('id'))
			->where("status > ?", 0)
			->order("name");
		}
		$vet = $vetri->fetchAll($recordSet)->toArray();
		return $vet;
		exit;
	}
}